package com.yh.csx.crm.dao;

import com.yh.csx.crm.po.SysSalesPermission;
import com.yh.csx.crm.qo.SalesQo;
import com.yh.csx.crm.vo.SalesInfoVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysSalesPermissionMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(SysSalesPermission record);

    int insertSelective(SysSalesPermission record);

    SysSalesPermission selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SysSalesPermission record);

    int updateByPrimaryKey(SysSalesPermission record);

    List<SysSalesPermission> selectByPhoneOrNameAndPositions(@Param("positions") List<String> positions,
                                                            @Param("phoneOrName") String phoneOrName);

    SysSalesPermission findByUserId(@Param("userId") Long userId);

    String selectPosition(Long userId);

    Long checkUserExist(@Param("userId") Long userId);

    String selectUserRole(Long userId);

    SysSalesPermission findByMobile(String mobile);

    List<SysSalesPermission> selectAll();

    List<SysSalesPermission> selectSalesList(SalesQo qo);

    int selectSalesCount(SalesQo qo);

    List<SalesInfoVo> selectSalesInfoList(SalesQo qo);

    int updateChildPath(@Param("oldPath") String oldPath, @Param("newPath") String newPath);
}